#include "signleton.hpp"

#include <iostream>

class TestA : public Signleton<TestA> {
  friend class Signleton<TestA>; // 因为构造函数为私有，声明为友元使instance(), 可以访问TestA的构造函数

 public:
  void display() { std::cout << "A:display\n"; }

 private:
  TestA(/* args */) {}
  ~TestA() {}
};

int main(int argc, char const* argv[]) {
  TestA& a = TestA::instance();
  std::cout << &a << "\n";
  a.display();
  TestA& b = a;
  std::cout << &b << "\n";
//   TestA c;
  return 0;
}
